#!/bin/bash
echo -e "\033[32mMake mj.a... \033[0m"
if [[ `uname` == 'Darwin' ]]; then
    echo "Mac OS"
    cp -f gen/libmj.a.macos gen/libmj.a
fi
if [[ `uname` == 'Linux' ]]; then
    echo "Linux"
    cp -f gen/libmj.a.centos gen/libmj.a

fi
echo -e "\033[32mMake mjhu.a... \033[0m"
make mjlib
echo -e "\033[32mCompile tile... \033[0m"
make tile
echo -e "\033[32mTest tile... \033[0m"
./tile
echo -e "\033[32mCompile server & client... \033[0m"
make mjsvr
make mjcli
echo -e "\033[32mRun server & client... \033[0m"
./mjsvr 8888 &
./mjcli 127.0.0.1 8888 client_input.txt 1

